#include "Generate_C_std.h"
#include "Pattern_assign_var.h"

class Pattern_assign_expr_param_is_ref : public Pattern_assign_var
{
public:
	Expr* rhs_pattern()
	{
		rhs = new Wildcard<Param_is_ref>;
		return rhs;
	}

	void generate_code (Generate_C* gen)
	{
		assert (!agn->is_ref);
		string function_name = *dyc<METHOD_NAME> (rhs->value->method_name)->value;
		string fci_name = suffix (function_name, "fci");
		string fcic_name = suffix (function_name, "fcic");

		INST (buf,
				"assign_param_is_ref", 
				s(function_name),
				rhs->value->get_filename (),
				s(lexical_cast<string> (rhs->value->get_line_number ())),
				s(fci_name),
				s(fcic_name),
				s(lexical_cast<string> (rhs->value->param_index->value)),
				lhs->value);
	}

protected:
	Wildcard<Param_is_ref>* rhs;
};


CREATE(Pattern_assign_expr_param_is_ref)
